<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>

        <script>
            var baseUrl = "<?php print Yii::app()->baseUrl . '/index.php/'; ?>";
            var baseUrlClean = "<?php echo Yii::app()->baseUrl; ?>";
        </script>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />

        <!-- blueprint CSS framework -->
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/menu.css"/>
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/menu_1.css"/>
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css"/>
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/widgets.css" />

        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
        <?php // Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/main.js'); ?>
        <?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/funciones.js'); ?>
        <?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/jquery.mask.min.js'); ?>

        <?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/menu.js'); ?>
        <?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/diasCalendario.js'); ?>



        <?php //Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/jquery-1.11.0.min.js'); ?>
    </head>

    <body>
        <div class="navbar navbar-fixed-top" >
            <div class="navbar-inner">
                <div class="container-fluid" id="navPrincipal">
                    <div class="row-fluid">
                        <div class="span3">
                            <div class="logo">
                                <!--<p style="color:whitesmoke" class="navbar-text pull-left" > RESTAURANTE</p>-->
                                <p style="color:whitesmoke" class="navbar-text pull-left" >RESTAURANTE  <?php echo CHtml::image(Yii::app()->baseUrl . "/images/chef_pq.png") ?></p>
                            </div>
                        </div>
                        <div class="span8 offset1">





                            <div class="btn-group nav pull-right "> 
                                <a class="btn btn-warning" <?php echo CHtml::link('<i class="icon-white icon-off "></i>&nbsp;&nbsp;Cerrar Sesiòn', Yii::app()->user->ui->logoutUrl) ?></a>                   
                            </div>
                        </div>


                    </div>

                </div>
            </div>
        </div>



        <div class="container-fluid" >
            <div class="row-fluid">
                <div class="span3" id="cssmenu">


                    <ul class="nav nav-list">
                        <li <?php echo!(Util::checkAccess(array('action_ui_usermanagementadmin'))) ? 'style="display:none"' : '' ?> class="has-sub"><a href='#'>Administración</a>
                            <ul>
                                <li <?php echo!(Util::checkAccess(array('action_ui_usermanagementadmin'))) ? 'style="display:none"' : 'visible="visible"' ?>  class="<?php echo is_object(YiiBase::app()->getController()->getModule()) ? (YiiBase::app()->getController()->getModule()->getId() == "cruge" ? "active" : "") : "" ?>"><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/users.png") . '  Usuarios y Permisos', Yii::app()->user->ui->userManagementAdminUrl) ?> </li>
                                <li <?php echo!(Util::checkAccess(array('action_ui_usermanagementcreate'))) ? 'style="display:none"' : 'visible="visible"' ?> ></li>
                            </ul>
                        </li>
                    </ul>

                    </ul>
                    <ul  class="nav nav-list">

                        <li <?php echo!(Util::checkAccess(array('action_empleado_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "empleado" ? "active" : "" ?>" ><?php echo CHtml::link(/* CHtml::image(Yii::app()->baseUrl . "/images/iconos/calendario.png") . */ 'Empleados', array('/empleados/empleado/admin')) ?></li>

                    </ul>
                    <ul  class="nav nav-list">
                        <li <?php echo!(Util::checkAccess(array('action_productoUnidad_admin', 'action_producto_admin'))) ? 'style="display:none"' : '' ?> class="has-sub"><a href="#">Productos</a>
                            <ul>   
                                <li <?php echo!(Util::checkAccess(array('action_producto_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "producto" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/lightbulb.png") . ' Administrar productos', array('/productos/producto/admin')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_producto_create'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "producto" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/vineta.png") . ' Crear producto', array('/productos/producto/create')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_productoIngreso_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "productoIngreso" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/escuelas.png") . ' Ingresar productos', array('/productos/productoIngreso/admin')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_productoUnidad_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "productoUnidad" ? "active" : "" ?>"><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/vineta.png") . 'Crear Unidad', array('/productos/productoUnidad/admin')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_producto_agotados'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "producto" ? "active" : "" ?>"><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/battery_low.png") . '  Productos agotados', array('/productos/producto/agotados')) ?></li>
                            </ul>
                        </li>
                    </ul>
                    </ul>
                    <ul  class="nav nav-list">
                        <li <?php echo!(Util::checkAccess(array('action_menuSeccion_admin', 'action_menu_admin'))) ? 'style="display:none"' : '' ?> class="has-sub"><a href="#">Menus</a>
                            <ul>   
                                <li <?php echo!(Util::checkAccess(array('action_menu_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "menu" ? "active" : "" ?>"><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/apple_2.png") . 'Administrar Menu', array('/menus/menu/admin')) ?></li>

                                <li <?php echo!(Util::checkAccess(array('action_menuSeccion_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "menuSeccion" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/vineta.png") . ' Secciones', array('/menus/menuSeccion/admin')) ?></li>
                            </ul>
                        </li>
                    </ul>
                    <ul  class="nav nav-list">
                        <li <?php echo!(Util::checkAccess(array('action_ticket_admin', 'action_pedido_admin', 'action_factura_admin'))) ? 'style="display:none"' : '' ?> class="has-sub"><a href="#">Ventas</a>
                            <ul>   
                                <li <?php echo!(Util::checkAccess(array('action_pedido_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "pedido" ? "active" : "" ?>"><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/shopping_cart_2.png") . 'Pedidos', array('/ventas/pedido/admin')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_factura_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "factura" ? "active" : "" ?>"><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/sale.png") . 'Facturas', array('/ventas/factura/admin')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_ticket_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "ticket" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/tag.png") . ' Tickets', array('/ventas/ticket/admin')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_cierreCaja_admin'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "cierreCaja" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/dollar_currency_sign.png") . ' Cierre de Cajas', array('/ventas/cierreCaja/admin')) ?></li>

                            </ul>
                        </li>
                    </ul>
                    <ul  class="nav nav-list">
                        <li <?php echo!(Util::checkAccess(array('action_ventaReporte_index', 'action_ventaReporte_reporteVentasEmpleado', 'action_ventaReporte_reporteVentasPorTiempo'))) ? 'style="display:none"' : '' ?> class="has-sub"><a href="#">Reportes</a>
                            <ul>   
                                <li <?php echo!(Util::checkAccess(array('action_ventaReporte_index'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "ventaReporte" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/chart.png") . ' Reporte general', array('/ventas/ventaReporte/index')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_ventaReporte_reporteVentasEmpleado'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "ventaReporte" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/chart.png") . ' Reporte de ventas por empleado', array('/ventas/ventaReporte/reporteVentasEmpleado')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_ventaReporte_reporteVentasPorTiempo'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "ventaReporte" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/chart.png") . ' Reporte de ventas por fechas', array('/ventas/ventaReporte/reporteVentasPorTiempo')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_ventaReporte_reporteRankingMenu'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "ventaReporte" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/chart.png") . ' Top menus vendidos', array('/ventas/ventaReporte/reporteRankingMenu')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_ventaReporte_reporteRankingNegativoMenu'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "ventaReporte" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/chart.png") . 'Menus Menos vendidos', array('/ventas/ventaReporte/reporteRankingNegativoMenu')) ?></li>
                            </ul>
                        </li>
                    </ul>
                    <ul  class="nav nav-list">
                        <li <?php echo!(Util::checkAccess(array('action_factura_historialFacturas'))) ? 'style="display:none"' : '' ?> class="has-sub"><a href="#">Historiales</a>
                            <ul>   
                                <li <?php echo!(Util::checkAccess(array('action_factura_historialFacturas'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "factura" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/page_full.png") . ' Historial facturas', array('/ventas/factura/historialFacturas')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_pedido_historialPedidos'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "pedido" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/page_full.png") . ' Historial pedidos', array('/ventas/pedido/historialPedidos')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_cierreCaja_historial'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "cierreCaja" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/page_full.png") . ' Historial Cierres de Caja', array('/ventas/cierreCaja/historial')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_productoIngreso_historial'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "productoIngreso" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/page_full.png") . ' Historial Egresos', array('/productos/productoIngreso/historial')) ?></li>
                                <li <?php echo!(Util::checkAccess(array('action_pedido_ganancias'))) ? 'style="display:none"' : 'visible="visible"' ?> class="<?php echo YiiBase::app()->getController()->getId() == "pedido" ? "active" : "" ?>" ><?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/dollar_currency_sign.png") . ' Historial Ganancias', array('/ventas/pedido/ganancias')) ?></li>
                                <!--<li <?php // echo!(Util::checkAccess(array('action_ventaReporte_reporteVentasEmpleado'))) ? 'style="display:none"' : 'visible="visible"'   ?> class="<? php echo YiiBase::app()->getController()->getId() == "ventaReporte" ? "active" : "" ?>" >< ?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/page_full.png") . ' Reporte de ventas por empleado', array('/ventas/ventaReporte/reporteVentasEmpleado')) ?></li>-->
                                <!--<li <?php // echo!(Util::checskAccess(array('action_ventaReporte_reporteVentasPorTiempo'))) ? 'style="display:none"' : 'visible="visible"'   ?> class="< ?php echo YiiBase::app()->getController()->getId() == "ventaReporte" ? "active" : "" ?>" >< ?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/iconos/participantes.png") . ' Reporte de ventas por fechas', array('/ventas/ventaReporte/reporteVentasPorTiempo')) ?></li>-->
                            </ul>
                        </li>
                    </ul>




                </div>



                <div class="span9">
                    <div class="row-fluid">
                        <div id="maiMessages" class="flash-messages">
                            <?php
                            $messages = Yii::app()->user->getFlashes();
                            if ($messages) {
                                foreach ($messages as $key => $message) {
                                    echo '<div class="alert alert-' . $key . '">'
                                    . '<button data-dismiss="alert" class="close" type="button">×</button>'
                                    . $message . "</div>\n";
                                }
                            }
                            ?>
                        </div>
                    </div>
                    <?php echo $content; ?>
                </div>
            </div>
        </div>

        <div class="clear"></div>

        <div id="footer">
            <!--FOOTER-->
        </div><!-- footer -->


        <div class="row-fluid">
            <?php
            // El modal de la pÃ¡gina
            $this->beginWidget('bootstrap.widgets.TbModal', array('id' => 'mainModal', 'options' => array('backdrop' => 'static')));
            $this->endWidget();
            ?>
        </div>

    </body>
</html>
